package cn.factory;

/**
 * Created by jt on 2018/3/12.
 */
public class Factory {

    public static ICar getInstance(String carName){
        ICar car = null ;
        if(carName.equals("BenZ")){
            car = new BenZ() ;
        }else if (carName.equals("BMW")){
            car = new BMW() ;
        }else{
            return car ;
        }
        return car ;
    }

}
